import requests
import execjs

headers = {
    'Accept': 'application/json, text/plain, */*',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Connection': 'keep-alive',
    'Content-Type': 'application/x-www-form-urlencoded',
    'Origin': 'https://www.qimingpian.com',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'cross-site',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',
    'sec-ch-ua': '"Chromium";v="118", "Google Chrome";v="118", "Not=A?Brand";v="99"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
}

data = {
    'channel_name': '24新声',
    'page': '1',
    'num': '20',
    'unionid': 'AxQL6PzFfm7jsk9f5YIq8nc8QmwKKpSA4xK9Vk4n6zGQX6HQ1VE8dfhXhe9i15ajeJWqqIs6kiQsM8IbOYgM5A==',
}

response = requests.post('https://vipapi.qimingpian.cn/Activity/channelInformationByChannelName', headers=headers, data=data)

response_data = execjs.compile(open("企名片解析JS.js", "r", encoding="utf-8").read()).call("decryptData", response.json()['encrypt_data'])
for item in response_data['list']:
    print(item)